=link_to("添加门店", "#", class: 'button', id: "store")
#chooser{class: 'modal2 fade',tabindex: -1, role: 'dialog',"aria-labelledby": 'myModalLabel'}
  = semantic_form_for([:admin,resource.company, resource], builder: ActiveAdmin::FormBuilder) do |f|
    = f.inputs '门店' do
      - assigns = Wallet.where(company_id: params[:company_id], online: true).pluck(:store_id).flatten
      = f.input :store_id,as: :select,input_html: {multiple: 'multiple'},collection: resource.company.stores.pluck(:name,:id),disabled: assigns,label: false,include_blank: false,include_hidden:false
    %br
    = f.submit("确定")
:javascript
  $(function(){
    var chooser =  $("#chooser");
    $("#store").on("click",function(e){
      e.preventDefault();
      chooser.modal('view',{
        speed : 200,
        easing : 'easeInOutElastic',
        animation : 'top height width',
        position: '10% auto',
        overlayClose : true,
        on : 'click',
        overlayColor : '#ccc',
        overlayOpacity : .9,
        close : '.close'
      });
    })
  })

